<script>
export default {
  name: 'searchBuilding',
  props: {
    /* 接收父组件传递过来的pageParams(查询楼宇的参数) */
    pageParams: {
      type: Object,
      default: () => ({})
    }
  },
  methods: {
    /* 点击查询按钮的回调函数 */
    handleSearch() {
      // 向父组件出发一个自定义事件
      this.$emit('search')
    }
  },
  emits: ['search']
}
</script>

<template>
  <el-form inline>
    <el-form-item label="楼宇名称">
      <el-input size="small" placeholder="请输入楼宇名称" v-model="pageParams.name"></el-input>
    </el-form-item>
    <el-form-item>
      <el-button size="small" type="primary" icon="el-icon-search" @click="handleSearch">查询</el-button>
    </el-form-item>
  </el-form>
</template>
